﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace TagCloudSoma
{
    public class InputCleaner
    {
        ProviderPattern _pP;
        String _input;

  
        public InputCleaner(String text)
        {
            _pP = new ProviderPattern();
            _input = text;
        }

        public InputCleaner()
        {
            _pP = new ProviderPattern();
        }

        #region Cleaner Function
        public string cleaner()
        {
            if (_input != "")
            {
                Regex reg;

                foreach (string pattern in _pP.Patterns)
                {
                    reg = new Regex(@pattern);
                    _input = reg.Replace(_input, string.Empty);
                }
               
                return _input;
            }
            return "";
        }
        #endregion

        #region Properties
        public string Inpunt
        {
            set { _input = value; }
        }
        #endregion
    }
}
